//
//  ICChatMessageReminderCell.m
//  ICome
//
//  Created by zhangrongwu on 2017/7/29.
//  Copyright © 2017年 iCom. All rights reserved.
//

#import "ICChatMessageReminderCell.h"
#import "ICReminderButton.h"
#import "ICHeaderFile.h"
@interface  ICChatMessageReminderCell()

@property (nonatomic, strong) ICReminderButton *reminderButton;

@end

@implementation ICChatMessageReminderCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self.contentView addSubview:self.reminderButton];
    }
    return self;
}

- (void)setModelFrame:(ICMessageFrame *)modelFrame
{
    [super setModelFrame:modelFrame];
    
    self.reminderButton.frame = modelFrame.bubbleViewF;
    self.reminderButton.messageModel = modelFrame.model;
}

#pragma mark - Event


#pragma mark - Getter

- (ICReminderButton *)reminderButton
{
    if (!_reminderButton) {
        _reminderButton = [ICReminderButton buttonWithType:UIButtonTypeCustom];
        WEAKSELF
        _reminderButton.reminderAction = ^(NSString *title) {
            NSLog(@"%@", title);
            
            NSDictionary * dict = @{@"from":weakSelf.modelFrame.model.message.from,
                                    @"name":weakSelf.modelFrame.model.message.senderName,
                                    @"text":title};
            [weakSelf routerEventWithName:GXRouterEventQuestionEvent userInfo:dict];
        };
    }
    return _reminderButton;
}





@end
